package com.mdh.runerrands.serviceImpl;

import com.mdh.runerrands.dao.CategoryDao;
import com.mdh.runerrands.pojo.Category;
import com.mdh.runerrands.service.ICategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CategoryServiceImpl implements ICategoryService {
    @Resource
    private CategoryDao categoryDao;
    @Override
    public boolean batchDelete(int... ids) {
        return categoryDao.batchDelete(ids);


    }

    @Override
    public boolean deleteById(int id) {
        return categoryDao.deleteById(id);
    }

    @Override
    public List<Category> query(int page, int pageSize, String name, String num) {
        page =(page -1)*pageSize;
        return categoryDao.query(page,pageSize,name,num);
    }

    @Override
    public int selectCount(String name, String num) {
        return categoryDao.selectCount(name,num);
    }

    @Override
    public boolean insert(Category category) {
        return categoryDao.insert(category);
    }

    @Override
    public boolean update(Category category) {
        return categoryDao.update(category);
    }

    @Override
    public List<Category> findAll() {
        return categoryDao.findAll();
    }
}
